{{ $_hugo_config := `{ "version": 1 }` }}
<!--
Usage (in english):
	{% def
		id="a unique id for anchor"
		name="The term to define (optional if abbr is provided)"
		abbr="an acronym (optional)"
		abbr_first="1 (When the acronym is more important, such as RSA or SSL)" %}
			the definition 
	{% /def %}
	
	<p><dfn id="a unique id for anchor">The term to define</dfn>: the definition</p>
	<p><dfn id="a unique id for anchor"><abbr>an acronym</abbr</dfn>: the definition</p>
	<p><dfn id="a unique id for anchor">The term to define</dfn> (<abbr>an acronym</abbr>): the definition</p>

Usage (in other languages):
	{% def 
		id="a unique id for anchor - the SAME than for english" 
		name="The term to define (optional if english or abbr is provided)"
		abbr="an acronym (optional)"
		english="the english term (optional - if present the abbr is in english too)"
		abbr_first="1 (When the acronym is more important, such as RSA or SSL)" %}}
			the definition
	{% /def %}

	<p><dfn id="def-a unique id for anchor">The term to define</dfn>: the definition</p>
	<p><dfn id="def-a unique id for anchor"><abbr>an acronym</abbr></dfn>: the definition</p>
	<p><dfn id="def-a unique id for anchor">The term to define</dfn> (<abbr>an acronym</abbr>): the definition</p>
	<p><dfn id="def-a unique id for anchor" lang="en">the english term</dfn> (<abbr>an acronym</abbr>): the definition</p>
	<p><dfn id="def-a unique id for anchor">The term to define</dfn> (<i lang="en">the english term</i>): the definition</p>
	<p><dfn id="def-a unique id for anchor">The term to define</dfn> (<abbr>an acronym</abbr> - <i lang="en">the english term</i>): the definition</p>

Notes:
	<abbr> is used to spell out for screen readers
	lang="en" is used for the accent for screen readers
-->

<p class="definition">
	<a href="#def-{{.Get "id" }}">
	{{- if and (.Get "abbr") (eq (.Get "abbr_first") "1") -}}
			<dfn id="def-{{.Get "id" }}"><abbr lang="en">{{ .Get "abbr" }}</abbr></dfn>
				{{- if .Get "name" }} ({{.Get "name" }}{{ if .Get "english" }} - <i lang="en">{{ .Get "english" }}</i>{{ end }})
				{{- else }}{{ if .Get "english" -}} (<i lang="en">{{ .Get "english" }}</i>{{ end }})
				{{- end }}
	{{- else -}}
		{{- if .Get "name" -}}
			<dfn id="def-{{.Get "id" }}">{{.Get "name" }}</dfn>
			{{- if or (.Get "abbr") (.Get "english") -}}
				{{- if .Get "english" }} ({{ with .Get "abbr" }}<abbr lang="en">{{ . }}</abbr> - {{ end -}}<i lang="en">{{ .Get "english" }}</i>)
				{{- else }} (<abbr>{{ .Get "abbr" }}</abbr>)
				{{- end }}
			{{- end }}
		{{- else -}}
			{{- if .Get "english" -}}
				<dfn id="def-{{.Get "id" }}" lang="en">{{.Get "english" }}</dfn>
				{{- if .Get "abbr" }} (<abbr lang="en">{{ .Get "abbr" }}</abbr>){{- end }}
			{{- else -}}
				<dfn id="def-{{.Get "id" }}"><abbr>{{.Get "abbr" }}</abbr></dfn>
			{{- end -}}
		{{- end -}}
	{{- end -}}
	</a>
	{{ .Site.Params.beforeColon | safeHTML }}: {{ .Inner }}
</p>
